<template>
	<view>
		<comments ref="datas" :datas="list"></comments>
	</view>
</template>

<script>
	import comments from '@/components/devm/product/comments.vue';

	var current = 1;
	export default {
		components: {
			comments
		},
		data() {
			return {
				skuId: '',
				list: []
			}
		},
		onLoad(options) {
			this.skuId = options.skuId;
			this.reqlist();
		},
		onReachBottom() {
			current++;
			this.reqlist();
		},
		methods: {
			reqlist() {
				this.$get('mall/comment/commonpage', {
					skuId: this.skuId,
					current:current 
				}, 'get', true).then((res) => {
					if (res.data && res.data.items) {
						for (var k = 0; k < res.data.items.length; k++) {
							this.list.push(res.data.items[k]);
						}
						//this.$refs.datas = this.list;
					}
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #FFFFFF;
	}
</style>
